<template>
  <div class="flex up" @click="download">
    <span class="upspan">导出</span>
    <img class="upimg" src="../assets/out.png" alt="" srcset="" />
  </div>
</template>
<script>
import { fileDownload } from "@/api/system";
export default {
  name: "Export",
  props: {
    url: { type: String, default: "" },
    formData: { type: Object, default: () => ({}) },
  },
  methods: {
    download() {
      fileDownload(this.url, { ...this.formData }).then((res) => {
        window.open(res.data);
      });
    },
  },
};
</script>
<style lang="less" scoped>
.up {
  margin-left: 10px;
  padding: 8px 20px;
  border: solid 1px #65a3fd;
  border-radius: 5px;
  cursor: pointer;
}
.upspan {
  color: #65a3fd;
  margin-right: 5px;
}
.upimg {
  width: 14px;
  height: 14px;
}
</style>